package com.sq.imp;

import com.sq.abstractClass.UpLabel;

import java.awt.*;
import java.util.function.Function;

public class UpLabelImp extends UpLabel {
    public UpLabelImp() {
    }

    @Override
    public void setFontString(Font font) {
        Function<Integer, String> function = style -> switch (style) {
            case (0) -> "普通";
            case (1) -> "粗体";
            case (2) -> "斜体";
            case (3) -> "粗斜体";
            default -> "";
        };
        this.font.setText(font.getFontName() +
                " " + function.apply(font.getStyle()) + " " + font.getSize());
    }

    @Override
    public void setFileIsChange(String Massage) {
        this.fileIsChange.setText(Massage);
    }


}
